<template>
  <div class="box">
    <div class="top">
      <v-alchemyNav></v-alchemyNav>
    </div>
    <div class="topbox">
      <ul>
        <li>
          <p>{{list.qingDan?list.qingDan : 0}}</p>
          <p>青丹 </p>
        </li>
        <li>
          <p>{{list.yinDan?list.yinDan : 0}}</p>
          <p>银丹 </p>
        </li>
        <li>
          <p>{{list.xianDan?list.xianDan : 0}}</p>
          <p>仙丹 </p>
        </li>
        <li>
          <p>{{list.jinDan ?list.jinDan: 0}}</p>
          <p>金丹 </p>
        </li>
      </ul>
      <div class="total">
        <p>总价值: </p>
        <p>{{ list.qingDan*this.exchange.qingdan + list.yinDan*this.exchange.yindan + list.xianDan*this.exchange.xiandan+ list.jinDan*this.exchange.jindan || 0 }}{{gametype}}
        </p>
        <p @click='$router.push({path:"/assetes"})'>一键卖出</p>
      </div>
    </div>
    <div class="botbox">
      <div data-title="售出记录" class="sr-title">售出记录</div>
      <div>
        <div class="list-head">
          <span data-title="编号" class="lh-title1">编号</span>
          <span data-title="青丹" class="lh-title2">青丹</span>
          <span data-title="银丹" class="lh-title3">银丹</span>
          <span data-title="仙丹" class="lh-title4">仙丹</span>
          <span data-title="金丹" class="lh-title5">金丹</span>
          <span data-title="审核" class="lh-title5">审核</span>
          <span data-title="售出时间" class="lh-title6">售出时间</span>
        </div>
        <ul v-if='listmore.length>0'>
          <li v-for='(item,index) in listmore' :key='index'>
            <span data-title="1" class="lh-title1">{{index+1}}</span>
            <span data-title="37株" class="lh-title2">{{item.qingdan}}株</span>
            <span data-title="30株" class="lh-title3">{{item.yindan}}株</span>
            <span data-title="3000BPX" class="lh-title4">{{item.xiandan}}株</span>
            <span data-title="2018-07-14 16:00" class="lh-title5">{{item.jindan}}株</span>
            <span data-title="2018-07-14 16:00" class="lh-title5">{{item.isPass?'审核通过':'未审核'}}</span>
            <span data-title="2018-07-14 16:00" class="lh-title6">{{item.operatingDate}}</span>
          </li>
        </ul>

      </div>
    </div>
  </div>
</template>

<script>
import alchemyNav from "../alchemyNav";
export default {
  data: function() {
    return {
      exchange: JSON.parse(localStorage.getItem("exchange")),
      gametype: u.getStore("winning").type,
      topboxli: [
        { title: "青丹", src: "../../../static/image/1.png" },
        { title: "青丹", src: "../../../static/image/2.png" },
        { title: "青丹", src: "../../../static/image/3.png" },
        { title: "青丹", src: "../../../static/image/4.png" }
      ],
      list: u.getStore("userInfo") || {},
      listmore: ""
    };
  },
  components: {
    "v-alchemyNav": alchemyNav
  },
  created() {
    console.log(this.exchange)
    let timer = setInterval(() => {
      if (u.flag) {
        this.list = u.getStore("userInfo");
        u.sellList({ phone: u.getStore("user").userid }, data => {
          if (data && data[0] && data[0].rechargeSellList) {
            this.listmore = data[0].rechargeSellList;
          }
        });
        clearInterval(timer);
      }
    }, 10);
  },
  mounted() {
    this.$parent.flag1 = false;
    this.$parent.flag2 = true;
  }
};
</script>

<style lang="less" scoped>
html,
body {
  width: 100%;
  height: 100%;
}
.box {
  padding: 0 34px;
  width: 100vw;
  height: 100vh;
  background: url("../../../static/image/danbg2.png") no-repeat;
  background-size: 100% 100%;
  background-position-y: -32px;
  padding: 30px 34px 50px 32px;
  .top {
    margin: 20px 0;
  }
  .tap {
    width: 95% !important;
  }
  .topbox {
    width: 684px;
    height: 365px;
    background: url("../../../static/image/ginsengbgtop.png") no-repeat;
    background-size: 100% 100%;
    padding: 76px 34px 0 34px;
    font-size: 20px;
    ul {
      display: flex;
      justify-content: space-between;
      li {
        width: 116px;
        height: 101px;
        background: url("../../../static/image/Base-1.png") no-repeat;
        text-align: center;
        background-size: 100% 100%;
        img {
          display: inline-block;
          padding-top: 10px;
        }
        > p:nth-of-type(1) {
          font-size: 30px;
          line-height: 2;
          color: white;
          text-shadow: 0 2.5px #3a230a, 2px 0 #3a230a, -2px 0 #3a230a, 0 -2px #3a230a;
        }
        p {
          color: #ffd327;
          text-shadow: 0 1.5px #a46c1d, 1px 0 #a46c1d, -1px 0 #a46c1d, 0 -1px #a46c1d;
        }
      }
    }
    div {
      display: flex;
      font-size: 24px;
      color: #ffffff;
      margin-top: 80px;
      & > p:first-of-type {
        // text-shadow: -2px 2px 1px #000;
        text-shadow: 0 2.5px #000, 2px 0 #000, -2px 0 #000, 0 -2px #000;
        margin-right: 18px;
        line-height: 43px;
      }
      & > p:nth-child(2) {
        font-size: 36px;
        // text-shadow: 2px 3px 0px #dfb779;
        text-shadow: 0 2.5px #dfb779, 2px 0 #dfb779, -2px 0 #dfb779, 0 -2px #dfb779;
        margin-right: 153px;
      }
      & > p:last-of-type {
        text-align: center;
        line-height: 49px;
        font-size: 24px;
        width: 193px;
        height: 60px;
        background: url(../../../static/image/z_1.png) no-repeat;
        background-size: 100% 100%;
        text-shadow: 0 2.5px #9c130b, 2px 0 #9c130b, -2px 0 #9c130b, 0 -2px #9c130b;
      }
    }
  }
  .total {
    p:nth-child(1) {
      width: 120px;
    }
  }
  .botbox {
    margin-top: 29px;
    width: 685px;
    height: 705px;
    background: url("../../../static/image/ginsengbgbot.png") no-repeat;
    background-size: 100% 100%;
    padding: 27px 30px;
    .sr-title {
      width: 379px;
      height: 90px;
      margin: 0 auto;
      text-align: center;
      background: url("../../../static/image/z_3.png") no-repeat;
      background-size: 100% 100%;
      font-size: 26px;
      font-weight: 700;
      color: #ffffff;
      line-height: 53px;
      text-shadow: 0 3.5px #1c6b65, 3px 0 #1c6b65, -3px 0 #1c6b65, 0 -2px #1c6b65;
    }
    .list-head {
      display: flex;
      justify-content: space-around;
      font-size: 22px;
      background: url("../../../static/image/z_4.png") no-repeat;
      width: 100%;
      height: 64px;
      line-height: 55px;
      background-size: 100% 100%;
      margin-top: 26px;
      margin-bottom: 35px;
      font-weight: bold;
      color: #fff;
      width: 98%;
      span {
        display: inline-block;
        text-align: center;
        text-shadow: 0 3.5px #a65d09, 3px 0 #a65d09, -3px 0 #a65d09, 0 -2px #a65d09;
      }
    }
    ul {
      max-height: 300px;
      overflow: auto;
      font-size: 18px;
      li {
        display: flex;
        justify-content: space-around;
        width: 99%;
        height: 59px;
        line-height: 59px;
        color: #fff;
        background-image: url(../../../static/image/z_5.png);
        background-size: 100% 100%;
        span {
          display: inline-block;
          text-align: center;
        }
      }
    }
    ul::-webkit-scrollbar {
      width: 10px;
    }
    ul::-webkit-scrollbar-track-piece {
      background-color: #ebcf8f;
      -webkit-border-radius: 5px;
    }
    ul::-webkit-scrollbar-thumb:vertical {
      background-color: #b6e866;
      -webkit-border-radius: 5px;
    }
    .lh-title1 {
      width: 11%;
    }
    .lh-title2 {
      width: 11%;
    }
    .lh-title3 {
      width: 10%;
    }
    .lh-title4 {
      width: 10%;
    }
    .lh-title5 {
      width: 12%;
    }
    .lh-title6 {
      width: 34%;
      // border: 1px solid #000;
      overflow: hidden;
    }
  }
}
</style>
